class ImageController < ApplicationController
  def view_by_leaf
    leaf = params[:id]
    leaf += "."+ params[:format] if !params[:format].empty?
    image = Image.find_by_leaf(leaf)

    if(image.nil?)
#      throw "No image found matching leaf #{leaf} .. #{params.inspect}"
      ImageFact.no_image
      return
    end

    redirect_to "/image_facts/show_raw/#{image.image_fact_id}", :status => 301
  end

end
